Understanding .rowconfigure() in tkinter video 2 tutorial

by: martin_heroux, 7 years ago


In the video, the variable 'container' is created then packed.

container = tk.Frame(self)
container.pack(side="top", fill="both", expand=True)

The next thing that is done is to apply .rowconfigure( ) and .columnconfigure( ). Given that .pack( ) was used on 'container', rather than .grid( ), I am not clear what the following two lines are doing:

container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)

Any help clarifying this issue would be appreciated.



You must be logged in to post. Please login or register an account.



Mainly that is used to just configure the weights. The weight just gives something some priority if there is extra space. Default weights are 0, and objects wont expand to fill empty space. With different weights, you can begin to give certain aspects priority to expand to fill space.

-Harrison 7 years ago

You must be logged in to post. Please login or register an account.